#include <iostream>
using namespace std;
void hanoi_towers(int quantity, int from, int to, int buf_peg)  
{	
	if (quantity != 0)
     {
       hanoi_towers(quantity-1, from, buf_peg, to);
       cout << from << " -> " << to << endl;
       hanoi_towers(quantity-1, buf_peg, to, from);
    }
	return ;
} 
 
int main()
{
    int start_peg=1, destination_peg=3, buffer_peg=2, plate_quantity;
    cout << "enter number of plates : " << endl;
    cin  >> plate_quantity;
    hanoi_towers(plate_quantity, start_peg, destination_peg, buffer_peg);
}